-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Labels in Container Config #750
Conversation
- only exposes in core the opportunity to add labels - this PR does NOT - pass through labels from a base image (should be in followup) - enable frontend labels access (should be in followup)
@@ -98,6 +99,23 @@ public Builder setExposedPorts(@Nullable List<Port> exposedPorts) { | |||
return this; | |||
} | |||
|
|||
/** | |||
* Sets the container's exposed ports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover copy-pasted comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-pasta strikes again, I'll fix these.
} | ||
return this; | ||
} | ||
|
||
/** | ||
* Sets the items in the "ExposedPorts" field in the container configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Map<String, String> badLabels = new HashMap<>(); | ||
badLabels.put("label-key", null); | ||
BuildConfiguration.builder(Mockito.mock(BuildLogger.class)) | ||
.setContainerConfiguration(ContainerConfiguration.builder().setLabels(badLabels).build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The try block should only be focused on the method being tested. I actually think BuildConfiguration.builder()
doesn't play a role. Maybe
Map<String, String> badLabels = ...
badLabels.put(...)
Builder builder = ContainerConfiguration.builder();
try {
builder.setLabels(badLabels);
Assert.fail(...);
} catch (...) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hrmm... looks like we might need to cleanup this whole test class :\
@@ -110,15 +111,26 @@ | |||
* @param exposedPorts the list of exposed ports to add | |||
* @return this | |||
*/ | |||
public Builder<T> setExposedPorts(@Nullable ImmutableList<Port> exposedPorts) { | |||
public Builder<T> setExposedPorts(@Nullable List<Port> exposedPorts) { | |||
if (exposedPorts == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could do the same thing here as with labels and use a ternary operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was going to, but figured it should be in a followup. This ImmutableList -> List change probably shouldn't be part of this PR either. I might go through and do some cleanup after this.
part of #751